import {defineStore} from "pinia";
import {getSevenDayWeather, getWeatherStatistics, getWind} from "@/service/modules/weather";

const useWeatherStore=defineStore("weatherStore",{
    state:()=>({
        sevenDayWeather:[],
        weatherStatistics:[],
        wind:[]
    }),
    actions:{
        async fetchSevenDayWeather(){
            this.sevenDayWeather=await getSevenDayWeather()
        },
        async fetchWeatherStatistics(){
            this.weatherStatistics=await getWeatherStatistics()
        },
        async fetchWind(){
            this.wind=await getWind()
        }
    }
})
export default useWeatherStore